<?php
require_once dirname(dirname(dirname(__FILE__))) . '/shared/config/config.php';
require_once DOCUMENT_ROOT . DIR_SHARED_DAO . 'dao_journal.php';
require_once DOCUMENT_ROOT . DIR_SHARED_DAO . 'dao_category.php';
require_once DOCUMENT_ROOT . DIR_SHARED_DAO . 'dao_journal_sub_detail.php';

$category_access = new dao_category();

$journal_id = 0;
if (!empty($_POST['journal_id'])) {
    $journal_id = $_POST['journal_id'];
}
$list = $category_access->get_all_categories_by_journal_id($journal_id);

foreach ($list as $i => $item) {
    ?>
    <option value="<?php echo $item['CategoryID'] ?>"
    <?php
    if (!empty($edit_article_old)) {

        if ($item['CategoryID'] == $edit_article_old['CategoryID']) {
            echo 'selected';
        }
    }
    ?>
            >
        <?php echo $item['Title'] ?> </option>
<?php 
}
?>